<tr>
  <td NOWRAP COLSPAN="4" ALIGN="middle" BGCOLOR="#dcdcdc">
    <table CELLSPACING="0" CELLPADDING="1" BORDER="0">
          <tr>
            <td><a href="<%=BoxStatic.servletDir%>BoxReservationViewAction?SubmitView=view&t=<%
              Calendar tmpCal = Calendar.getInstance(sec.getTimeZone());
              tmpCal.setTime(currentDate.getTime());
              tmpCal.add(Calendar.MONTH, -1);
              out.print(tmpCal.getTime().getTime());
            %>">
            <img SRC="<%=BoxStatic.imageDir%>cal_left.gif" WIDTH="11" HEIGHT="11" BORDER="0"></a>
            </td>
            <td NOWRAP VALIGN="center"><tt><b>
			      	 <%=StringUtil.getDateTimeFormatString(sec.getTimeZone(), BoxStatic.LONG_DATE_FORMAT, currentDate.getTime())%>
            </b></tt> </td>
            <td><a href="<%=BoxStatic.servletDir%>BoxReservationViewAction?SubmitView=view&t=<%
              tmpCal.add(Calendar.MONTH, 2);
              out.print(tmpCal.getTime().getTime());
            %>">
            <img SRC="<%=BoxStatic.imageDir%>cal_right.gif" WIDTH="11" HEIGHT="11" BORDER="0"></a>
            </td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td align="middle" COLSPAN="4"><table BGCOLOR="#ffffff" CELLSPACING="3" CELLPADDING="1"
        BORDER="0">
          <tr>
<%
    Calendar start = Calendar.getInstance(sec.getTimeZone());
    Calendar end = Calendar.getInstance(sec.getTimeZone());
  //TODO: Share with Calendar
    home.getMonthStartEnd(start,end,currentDate);

    long endTime = end.getTime().getTime();
    tmpCal.setTime(start.getTime());
    int currentYear = currentDate.get(Calendar.YEAR);
    int currentMonth = currentDate.get(Calendar.MONTH);
    int currentDay = currentDate.get(Calendar.DAY_OF_YEAR);
    for(int i = 1; i <= 7; i++)
    {
%>
      <td valign="top" align="right">
      <font size="-1"><%=BoxStatic.shortWeekSymbols[i]%><br>
<%
      while(tmpCal.getTime().getTime() <= endTime)
      {
        boolean sameDay = (currentDay == tmpCal.get(Calendar.DAY_OF_YEAR)
                            && currentYear == tmpCal.get(Calendar.YEAR) );
        boolean sameMonth = (tmpCal.get(Calendar.MONTH) == currentMonth);
        if ( sameDay )
        {
          out.print("<font color=\"black\"><b>" + tmpCal.get(Calendar.DATE)+"</b></font><br>");
        }
        else
        {
          out.print("<a href=\""+BoxStatic.servletDir+"/BoxReservationViewAction?VIEW_FORMAT=DAY&t="+tmpCal.getTime().getTime()+"\">");
          if ( !sameMonth )
            out.print("<font color=\"#999999\">");
          out.print(tmpCal.get(Calendar.DATE));
          if ( !sameMonth )
            out.print("</font>");
          out.print("</a><br>");
        }
        tmpCal.add(Calendar.DAY_OF_YEAR,7);
      } //end while
      out.print("</font> </td>");

      tmpCal.setTime(start.getTime());
      tmpCal.add(Calendar.DAY_OF_YEAR,i);
    } //end for
%>
          </tr>
    </table>
  </td>
</tr>
